package com.svconnect.plugin.readers;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class WSDLoader {

	public static String load(String urlToRead) throws IOException {
		URL url;
		HttpURLConnection conn;
		BufferedReader rd;
		String line;
		StringBuffer sb = new StringBuffer();
		url = new URL(urlToRead);
		conn = (HttpURLConnection) url.openConnection();
		conn.setRequestMethod("GET");
		rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
		while ((line = rd.readLine()) != null) {
			sb.append(line);
			sb.append("\n");
		}
		rd.close();
		return sb.toString();
	}
}
